home *** CD-ROM | disk | FTP | other *** search
/ 3D Game Programming All in One / 3D Game Programming All in One Disc.iso / 3D2E / demo / client / scripts / playGui.cs < prev    next >
Encoding:
Text File  |  2005-11-23  |  1.3 KB  |  53 lines

  1. //-----------------------------------------------------------------------------
  2. // Torque Game Engine 
  3. // Copyright (C) GarageGames.com, Inc.
  4. //-----------------------------------------------------------------------------
  5.  
  6. //-----------------------------------------------------------------------------
  7. // PlayGui is the main TSControl through which the game is viewed.
  8. // The PlayGui also contains the hud controls.
  9. //-----------------------------------------------------------------------------
  10.  
  11. function PlayGui::onWake(%this)
  12. {
  13.    // Turn off any shell sounds...
  14.    // alxStop( ... );
  15.  
  16.    $enableDirectInput = "1";
  17.    activateDirectInput();
  18.  
  19.    // Message hud dialog
  20.    Canvas.pushDialog( MainChatHud );
  21.    chatHud.attach(HudMessageVector);
  22.  
  23.    // just update the action map here
  24.    moveMap.push();
  25.    
  26.    // hack city - these controls are floating around and need to be clamped
  27.    schedule(0, 0, "refreshCenterTextCtrl");
  28.    schedule(0, 0, "refreshBottomTextCtrl");
  29. }
  30.  
  31. function PlayGui::onSleep(%this)
  32. {
  33.    Canvas.popDialog( MainChatHud  );
  34.    
  35.    // pop the keymaps
  36.    moveMap.pop();
  37. }
  38.  
  39.  
  40. //-----------------------------------------------------------------------------
  41.  
  42. function refreshBottomTextCtrl()
  43. {
  44.    BottomPrintText.position = "0 0";
  45. }
  46.  
  47. function refreshCenterTextCtrl()
  48. {
  49.    CenterPrintText.position = "0 0";
  50. }
  51.  
  52.  
  53.